<?php 
namespace App\Models;

use Illuminate\Database\Eloquent\Model;



class Galleries extends Model {

	protected $table = 'galleries';
        
	protected $fillable = array('user_id', 'name', 'type');
        
        public function getGallery($user_id){
            if(!$gallery = Galleries::where('user_id',$user_id)->first()){
                return false;            
            }
            return $gallery;
        }
        public function getPublicGalleryByUserId($user_id){
            if(!$gallery = Galleries::select('id', 'user_id', 'name', 'type')->where('user_id',$user_id)->first()){
                return false;            
            }
            return $gallery;
        }
}